<template>
    <view>
        <view class="cu-bar tabbar bg-white shadow foot">

            <view class="action " :class="page===1?'text-green':'text-gray'" @click="NavChange" data-cur="index">
                <view :class="page===1?'cuIcon-homefill':'cuIcon-home'"></view> 首页
            </view>

            <view class="action text-gray add-action" @click="NavChange" data-cur="release">
                <button class="cu-btn cuIcon-add bg-green shadow"></button>
                发布
            </view>

            <view class="action" :class="page===3?'text-green':'text-gray'" @click="NavChange" data-cur="mine">
                <view :class="page===3?'cuIcon-myfill':'cuIcon-my'">
                    <view class="cu-tag badge" v-if="tag"></view>
                </view>
                我的
            </view>
        </view>
    </view>
</template>

<script>
    import {
        mapState,
        mapActions
    } from 'vuex'
    export default {
        name: 'tabs',
        props: {
            page: {
                type: Number
            }
        },
        data() {
            return {
                PageCur: 'index'
            }
        },
        computed: {
            ...mapState(['tag'])
        },
        onHide() {
        },
        methods: {
            NavChange: function(e) {
                if (e.currentTarget.dataset.cur == 'release') {
                    uni.navigateTo({
                        url: '/pages/' + e.currentTarget.dataset.cur + '/index'
                    });
                }

                uni.redirectTo({
                    url: '/pages/' + e.currentTarget.dataset.cur + '/index'
                });
            },
           
        }
    }
</script>

<style>

</style>
